using Vin.Extension.Framework.Signals.Enum;

namespace Vin.Extension.Framework.Signals.ServiceInterface;

public interface IVinSignalService
{
    /// <summary>
    /// 发送信号
    /// </summary>
    public Task<string> SendSignalAsync(TimeSpan? expireTime = null, string prefix = "");

    /// <summary>
    /// 检查信号
    /// </summary>
    /// <returns></returns>
    public Task<long> CheckSignalAsync(string key, string prefix = "");
    
    /// <summary>
    /// 检查并移除信号 (返回0 则是未知信号，返回1 则是已知信号，2是重复信号)
    /// </summary>
    public Task<SignalStatus> CheckRemoveSignalAsync(string key, string prefix = "");

    /// <summary>
    /// 移除信号
    /// </summary>
    public Task<bool> RemoveSignalAsync(string key, string prefix = "");
}